#include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{
	string s, t;
	getline(cin, s);
	getline(cin, t);
	int count = 0;
	int pos = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] >= 'a' && s[i] <= 'z') {
			s[i] -= 32;
		}
	}
	for (int i = 0; i < t.size(); i++) {
		if (t[i] >= 'a' && t[i] <= 'z') {
			t[i] -= 32;
		}
	}
	s = " " + s + " ";
	t = " " + t + " ";
	pos = t.find(s);
	int ans = pos;
	while (pos != -1) {
		count++;
		pos = t.find(s, pos + 1);
	}
	if (count) {
		cout << count << " " << ans << endl;
	}
	else {
		cout << -1 << endl;
	}
	return 0;
}